package backend

import (
	"AccessAdmin/internal/model"
	"github.com/gogf/gf/v2/frame/g"
)

type RoleIndexReq struct {
	g.Meta `path:"/role/index" method:"get" summary:"角色列表页面" tags:"角色"`
}

type RoleIndexRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

type RoleListReq struct {
	g.Meta   `path:"/role/list" method:"get" summary:"角色列表数据" tags:"角色"`
	Name     string `json:"name"`
	Identify string `json:"identify"`
	Status   int    `json:"status"`
	CommonPaginationReq
}

type RoleListRes struct {
	Data interface{} `json:"data"`
	CommonPaginationRes
}

type RoleShowCreateReq struct {
	g.Meta `path:"/role/create" method:"get" summary:"角色创建页面" tags:"角色"`
}

type RoleShowCreateRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

type RoleCreateReq struct {
	g.Meta   `path:"/role/create" method:"post" summary:"角色创建" tags:"角色"`
	Name     string `json:"name"`
	Identify string `json:"identify"`
	Status   int    `json:"status"`
	Sort     int    `json:"sort"`
	Remark   string `json:"remark"`
}

type RoleCreateRes struct {
	RoleId uint
}

type RoleShowUpdateReq struct {
	g.Meta `path:"/role/update/{Id}" method:"get" summary:"角色创建页面" tags:"角色"`
	Id     uint `json:"id"`
}

type RoleShowUpdateRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

type RoleUpdateReq struct {
	g.Meta   `path:"/role/update/{Id}" method:"post" summary:"角色创建" tags:"角色"`
	Id       uint   `json:"id"      v:"min:1#请选择需要修改的角色" dc:"角色Id"`
	Name     string `json:"name"`
	Identify string `json:"identify"`
	Status   int    `json:"status"`
	Sort     int    `json:"sort"`
	Remark   string `json:"remark"`
}

type RoleUpdateRes struct{}

type RoleShowViewReq struct {
	g.Meta `path:"/role/view/{Id}" method:"get" summary:"角色创建页面" tags:"角色"`
	Id     uint `json:"id"      v:"min:1#请选择需要查看的角色" dc:"用户Id"`
}

type RoleShowViewRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

type RoleDeleteReq struct {
	g.Meta `path:"/role/delete/{Id}" method:"post" summary:"角色删除" tags:"角色"`
	Id     uint `json:"id"      v:"min:1#请选择需要删除的角色" dc:"角色Id"`
}

type RoleDeleteRes struct{}

type RoleXmSelectReq struct {
	g.Meta `path:"/role/select" method:"get" summary:"xmSelect组件获取角色信息，不分页" tags:"角色"`
	UserId uint `json:"user_id"    dc:"角色Id"`
}

type RoleXmSelectRes struct {
	Items []CommonXmSelectRes `json:"items"    dc:"数据"`
}

type RoleShowAuthReq struct {
	g.Meta `path:"/role/auth/{Id}" method:"get" summary:"角色授权页面" tags:"角色"`
	Id     uint `json:"id"`
}

type RoleShowAuthRes struct {
	Items []model.UserRoleAuthTreeOutput `json:"items"    dc:"数据"`
}

type RoleAuthReq struct {
	g.Meta `path:"/role/auth/{Id}" method:"post" summary:"角色授权" tags:"角色"`
	Id     uint   `json:"id"`
	AuthId []uint `json:"auth_id"`
}

type RoleAuthRes struct{}
